 <?php
  $cat_ids = $this->session->userdata("cat_ids");
  
  if($cat_ids){
 
 ?>
 <?php foreach($cat_ids as $key => $row){ ?>
 <tr>
            
            <?php 
            $this->db->where("category_id",$key);
            $cats = $this->db->get("material_categories")->result_array(); ?>
            
            <td><?php echo $cats[0]["category_name"]; ?></td>
            <td><?php echo $row["amount"];  ?></td>
            <td><?php echo $row["remark"];  ?></td>
           	
            <td><input class="submit" type="button" value="ลบ" onclick="remove_item(<?php echo $key; ?>);" />
            
        
            
            </td>
</tr>
<?php } ?>
<?php } ?>
 <tr>
                           <td><?php $this->p->category_options(); ?> </td>
           <td><input id="amount" style="width: 40px;" name="amount" class="amount" value="<?php echo set_value("amount","1"); ?>" type="text" /></td>
           <td><input id="remark" name="remark" class="remark" value="<?php echo set_value("remark"); ?>" type="text" /></td>
           	
          <td><input class="submit" type="button" onclick="add_item();" value="เพิ่มรายการ"  /></td>
              </tr>
             